<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="speechDetail.title"/></title>
<content tag="heading"><fmt:message key="speechDetail.heading"/></content>

<spring:bind path="speech.*">
    <c:if test="${not empty status.errorMessages}">
    <div class="error">    
        <c:forEach var="error" items="${status.errorMessages}">
            <img src="<c:url value="/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
            <c:out value="${error}" escapeXml="false"/><br />
        </c:forEach>
    </div>
    </c:if>
</spring:bind>

<spring:htmlEscape defaultHtmlEscape="true"/>
<form:form commandName="speech" method="post" action="editSpeech.html" onsubmit="return validateSpeech(this)" id="speechForm">
<ul>
    <form:hidden path="id"/>
    <li>
        <toastmaster:label styleClass="desc" key="speech.title"/>
        <form:errors path="title" cssClass="fieldError"/>
        <form:input path="title" id="title" cssClass="text medium"/>
    </li>

    <li>
        <toastmaster:label styleClass="desc" key="speech.user"/>
        <form:errors path="user" cssClass="fieldError"/>
	<c:import url="/common/speakerList.jsp">
		    <c:param name="role" value="speaker_id"/>
		    <c:param name="user" value="${speech.user.id}"/>
	</c:import>
    </li>

    <li>
        <toastmaster:label styleClass="desc" key="speech.TMProject"/>
        <form:errors path="TMProject" cssClass="fieldError"/>
        <c:import url="/common/projectList.jsp">
		    <c:param name="name" value="project_id"/>
		    <c:param name="project" value="${speech.TMProject.id}"/>
	</c:import>
    </li>

    <li>
        <toastmaster:label styleClass="desc" key="speech.date"/>
        <form:errors path="date" cssClass="fieldError"/>
        <form:input path="date" id="date" cssClass="text medium"/>
    </li>

    <li class="buttonBar bottom">
        <input type="submit" class="button" name="save"  onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
        <input type="submit" class="button" name="delete" onclick="bCancel=true;return confirmDelete('Speech')" value="<fmt:message key="button.delete"/>" />
        <input type="submit" class="button" name="cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>" />
    </li>
</ul>
</form:form>

<script type="text/javascript">
    Form.focusFirstElement($('speechForm'));
</script>

<v:javascript formName="speech" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript"  src="<c:url value="/scripts/validator.jsp"/>"></script>
